<?php
function GetOneItem($msisdn, $crt_no) {
	$ret = '<lista xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" balance="10.0" cost="0.0" exception-index="0" method-index="1" reserve="0.0" crt-no="'.$crt_no.'" other-status="1" xsi:type="java:buz.SubscriberInfo"><client-id></client-id><exception-name></exception-name><msisdn>'.$msisdn.'</msisdn><terminal-ip></terminal-ip><currency>EUR</currency><imsi></imsi><method-name>hasCredit2</method-name><custom-status-string>STATUS_OK</custom-status-string><reserve-id></reserve-id></lista>';
	return $ret;
}

$head = '<?xml version="1.0" encoding="UTF-8"?>
<custom-list>';
$foot = '</custom-list>';
$mid = '';

$crt_no = 1;

for ($i = 240000000; $i <= 240030000; $i++)
	$mid .= GetOneItem($i, $crt_no++);
$h = fopen('subscribersDataXMLFile2.xml', 'w');
$xml = $head.$mid;
$c = fwrite($h, $xml);
fclose($h);
echo $c." characters writen";

$mid = '';
for ($i = 241000000; $i <= 241008000; $i++)
	$mid .= GetOneItem($i, $crt_no++);
$h = fopen('subscribersDataXMLFile2.xml', 'a');
$xml = $mid.$foot;
$c = fwrite($h, $xml);
fclose($h);
echo $c." characters writen";

/*
$mid = '';
for ($i = 242000000; $i <= 242008000; $i++)
	$mid .= GetOneItem($i, $crt_no++);
$xml = $mid.$foot;
*/

$h = fopen('subscribersDataXMLFile.xml', 'a');
$c = fwrite($h, $xml);
fclose($h);
echo $c." characters writen";
?>